﻿@using QDT.Common
@model System.Collections.Generic.IList<QDT.Core.Projects.ProjectImage>

@{
    ViewBag.Title = "title";
}

<div class="main_title">
    相关资料
</div>
<div class="blank5">
</div>
<div class="button_row">
    @Html.ActionLink("新增", "AddImage", new {id=ViewContext.RouteData.Values["id"]}, new {@class = "button"})
    <a class="button" href="javascript:  deleteMethod('','DeleteImage')">删除</a>
</div>
<div class="blank5">
</div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column => {
                                  column.CheckBox(x => x.ID);
                                  column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;");
                                  column.For(x => Html.ActionLink(x.Title, "EditProject", new {
                                                                                                  id = x.ID
                                                                                              })).Named("标题").SortColumnName("Title");
                                  column.For(x => new HtmlString("<img src=\"" + x.Thumbnail + "\" style='width:96px;height:68px'/>")).Named("缩略图").Sortable(false);
                                  column.For(x => x.Sort).Named("排序").HeaderAttributes(style => "width:50px;");
                                  ;
                                  column.For(x => x.CreateTime).Named("创建时间").HeaderAttributes(style => "width:180px;").SortColumnName("CreateTime");

                                  column.Buttons(btns => btns.Add(x => Html.ActionLink("编辑", "EditImage", new {
                                                                                                                  id = x.ID
                                                                                                              }))
                                                             .Add(x => Html.ScriptLink("彻底删除", "deleteMethod({0},'{1}')", x.ID, "DeleteImage"))
                                                             .Add(x => new HtmlString("<a href='{0}' target='_blank'>大图预览</a>".FormatWith(x.Photo))));
                              
        }).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
